Copyright: © 2003 by Boris Loboda


Welcome

Database Comparer utility allow you to find differences between two InterBase database structures. Database Comparer extract database metadata (directly from databases or from DDL/SQL-scripts), and compare it. After compare Database Comparer generate result script to update Target database to Master database structure. If Target database accesible, possible update it structure by running result update script.

Database aliases

Select databases to compare

Compare options: DB-Objects / Additional options

Update Script

Databases Metadata

DB-Tree


Getting started

Compare databases directly.

Compare databases from scripts.


Compare databases directly

To compare databases directly (if you have access to both databases) on "Compare" tab select Master and Target database Aliases to compare. Check compare options (Objects, Compare Options), and press [Compare] button.


Compare databases from script

For compare databases from DDL-script (*.DDL, *.SQL-files) on Compare -> Databases tab check "Master DB Script" and "Target DB Script" checkboxes and select script files to its fields.


Database aliases

"Options" tab have list of database aliases. To add new database alias use "New database Alias..." command from "Database"-menu.

Database Path...

 - Database path for access to database. For local databases this is path to database file. For remote databases - this <ServerName>:<Local path>.

Alias...

  - Database alias to display into databases list.

Role..., Username..., Password...

 - Database connect parameters.

Backup to file...

 - File name to backup database, if you use backup. Database Comparer use Servises API to backup/restore database. This server-relative path.

Restore from file...

 - File name to restore database from file.

For manage database aliases "Database"-menu have commands to add, copy, edit and delete Aliases.


Compare databases

"Compare" tab - is a main utility tab.

"Databases" - select Master and Target databases to compare. After select databases press [Compare] button to extract databases structures and compare it. Check Update Script after compare.


Databases to compare

For compare database select it on Compare -> Databases tab. Master database is a pattern database. Select Master database into "Master DB" alias-combobox, or check "Master DB Script" checkbox to get master database from selected script.

Target DB - is a database, what must update to master-database structure. Select it into "Target DB" alias-combobox, or check "Target DB Script" checkbox, if target database must extract from script.

After press [Compare] button Database Comparer extract master and target databases, compare both databases and generate update script to modify target database structure, if you compare differences databases.


Compare options

Database objects

Additional options


DB-Objects to compare

DB-objects to compare:

Database Comparer allow you to compare database by difference db-objects. If need compare database structures by selected objects, check need options on "Objects" tab.


Additional options

Compare options

Database: DEFAULT CHARACTER SET

 - Compare database DEFAULT CHARACTER SET. if option checked Database Comparer check Master and Target databases charset. If it find differences - Database Comparer generate statement to update Target database DEFAULT CHARACTER SET.

Fields: CHARACTER SET & COLLATE

 - Check fields charset and collation. If option checked, Database Comparer include charset- and collation- parameters in compare-criteria.

Show Metadata

 - Show databases metadata after compare (see Databases Metadata).

Show DB-Tree

 - Show databases tree after compare (DB -Tree).

Repeat Compare & Update

 - Option to Batch Compare/Update mode. Automatically repeat compare & update process need count passes, while Database Comparer not find differences between databases.


Update Script

"Update Script" show target database update script after databases compare.

Left tree by default show statements sequence of updated script. Right memo show generated SQL-script text. If you select statent into tree, memo cursor move to its line.

Update Script is a "interactive", possible edit script statements, reorder, enable/disable, and etc.

TaskBar commands:

  - Statements Sequence / Statements tree mode. In the "Statements Sequence" mode tree show statements by sequence order into update script. This is a default mode. In the "Statements Tree" mode tree show statements by groups of database objects types (domains, tables, procedures, triggers and etc.).

 - Show errors. If after update script execution any of statements run with error, Database Comparer show filtered list of errror statements.

 - Enable statement. Enable current statement to execute. Enabled statements run to update Target database.

 - Disable statement. By running update script disabled statements ignored.

 - Edit statement. Use "Edit statement" to change SQL-text of selected statement, if need. Database Comparer run internal text editor to change SQL-statement text.

 - Move Up. Move current statement up into update script (place before previous statement).

 - Move Down. Move current statement down into update script (after next statement).

 - Execute Statement. Database Comparer connect to Target database, execute current statement and disconnect from database.

 - Execute Script. Run update script to modify Target database structure.

 - Save Update Script. Save update script after edit.


Databases Metadata

"Metadata" tab show metadata script to compared databases.


DB-Tree

DB-Tree show compared database metadata as tree.

Root nodes containts database objects by type. After root node expand, tree show database objects from compared databases.

If you select db-object into tree, right memos show this object metadata from Master and Target databases. If object not exists into Master or Target database - its memo show empty declaration.

State images inform about db-objects differences:

 - Add state. Object exists into Master database and not exists into Target database. Object must be exist into Target.

 - Delete(Drop). Object exists into Target database and not exists into Master. Need delete (drop) this object from Target.

 - Update state. Object exists into Master and Target databases and have difference declaration. Need update this object.

 - No update state. Object exists into Master and Target databases and not have differences. No need update this object.


Batch Compare / Update

Database Comparer support batch-mode for Compare/Update process.